<?php if ($form->hasGlobalErrors()): ?>
    <div class="alert alert-error">
        <?php foreach ($form->getGlobalErrors() AS $error) : ?>
            <?php echo $error ?>
        <?php endforeach; ?>
    </div>
<?php endif ?>

<div class="portlet box green">
    <div class="portlet-title">
        <div class="caption"><i class="icon-reorder"></i>Ажилтан бүртгэх</div>
        <div class="tools">
            <a href="javascript:;" class="collapse"></a>
        </div>
    </div>
    <div class="portlet-body">
        <form class="form-horizontal" method="POST" enctype="multipart/form-data" id="form">
            <input type="hidden" name="id" value="<?php echo $id ? $id : 0 ?>" />

            <div class="control-group <?php if ($form['type']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['type']->renderId() ?>"><?php echo $form['type']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['type']->render(); ?>
                    <?php if ($form['type']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['type']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group <?php if ($form['store_id']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['store_id']->renderId() ?>"><?php echo $form['store_id']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['store_id']->render(); ?>
                    <?php if ($form['store_id']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['store_id']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group <?php if ($form['username']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['username']->renderId() ?>"><?php echo $form['username']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['username']->render(); ?>
                    <?php if ($form['username']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['username']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group <?php if ($form['pass']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['pass']->renderId() ?>"><?php echo $form['pass']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['pass']->render(); ?>
                    <?php if ($form['pass']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['pass']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group <?php if ($form['pass']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['pass_confirm']->renderId() ?>"><?php echo $form['pass_confirm']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['pass_confirm']->render(); ?>
                    <?php if ($form['pass']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['pass']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group <?php if ($form['firstname']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['firstname']->renderId() ?>"><?php echo $form['firstname']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['firstname']->render(); ?>
                    <?php if ($form['firstname']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['firstname']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group <?php if ($form['lastname']->hasError()): ?>error<?php endif; ?>">
                <label class="control-label" for="<?php echo $form['lastname']->renderId() ?>"><?php echo $form['lastname']->renderLabel() ?></label>
                <div class="controls">
                    <?php echo $form['lastname']->render(); ?>
                    <?php if ($form['lastname']->hasError()): ?>
                        <span class="help-inline"><?php echo $form['lastname']->renderError() ?></span>
                    <?php endif; ?>
                </div>
            </div>

            <div class="control-group">
                <div class="controls">
                    <button class="btn btn-success" type="submit">
                        <i class="icon-pencil icon-white"></i> Хадгалах
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>